<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<script>
		//<![CDATA[		
		function operationFormatter(v, m , r, rIndex){
			var isfirst = r.get("isFirst");
			var islast = r.get("isLast");		
			var userId = r.get("id");
			//alert("dirid:"+dirid);
			var up = "<a href='javascript:upDir(\""+userId+"\")'>上移</a>";
			var down = "<a href='javascript:downDir(\""+userId+"\")'>下移</a>";
			var ret ="";
			if(isfirst=="Y" && islast=="Y"){
				ret = ret + "--";
			}else if(isfirst=="Y" && islast=="N"){
				ret = ret + down;
			}else if(isfirst=="N" && islast=="Y"){
				ret = ret + up;
			}else{
				ret = up + "|" + down;
			}	
			
			return ret;		
		}
		function upDir(userId){
			theDirIdJsvar.setValue(userId);
			upjsvar.fireEvent("click",userId);
		}	
		function downDir(userId){		
			theDirIdJsvar.setValue(userId);
			downjsvar.fireEvent("click",userId);
		}	
		//]]>
		</script>
	</w:head>
	<w:page title="部门人员一览">
		<layout:panel border="false" autoHeight="true">
			<w:dataGrid id="securityUserGrid" toolBarPosition="bottom" rows="15" paged="true" border="false"
				showRowNumber="true" styleClass="k4-view-datagrid" autoHeight="true" forceFit="true">
				<w:outputColumn id="fullname" header="人员名称" width="62"></w:outputColumn>
				<w:outputColumn id="operation" header="操作" width="120" clientFormatter="operationFormatter">
				</w:outputColumn>
				<w:outputColumn id="isFirst" header="是否第一" width="100" hidden="true"></w:outputColumn>
				<w:outputColumn id="isLast" header="是否最后" width="100" hidden="true"></w:outputColumn>
				<w:outputColumn id="id" header="userId" width="80" hidden="true"></w:outputColumn>
				<w:outputColumn id="indexNumber" header="序列号" width="80" hidden="true"></w:outputColumn>
			</w:dataGrid>
			<w:form>
				<w:button id="up" value="" jsvar="upjsvar" style="display:none;" />
				<w:button id="down" value="" jsvar="downjsvar" style="display:none;" />
				<w:textField id="theDirId" jsvar="theDirIdJsvar" style="display:none;"></w:textField>
			</w:form>
		</layout:panel>
	</w:page>
</f:view>